System and method for processing external conditional branch instructions

ABSTRACT

A method and apparatus for executing conditional branch instructions by a data processing system containing a programmable microprocessor and multiple VLSI gate arrays connected by a bi-directional bus, whereby a branch condition is obtained from a storage location resident on a VLSI gate array executing asynchronous and external to the microprocessor. The branch condition is fetched and evaluated in parallel with the fetching of the branch target address and the incrementing of the program counter. The microprocessor changes instruction sequence control depending on the results of the branch condition evaluation.

This is a continuation of application Ser. No. 08,173,740 filed on Dec. 23, 1993, now abandoned.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is related to the concurrently filed applications listed below, the disclosures of which are incorporated herein by reference. All of the listed applications are assigned to the same assignee as the present invention.

Microsequencer Bus Controller System, Ser. No. 08/172,657, now pending, invented by Larry L. Byers, Joseba M. De Subijana, and Wayne A. Michaelson.

Stuck Fault Detection For Branch Instruction Condition Signals, Ser. No. 08/173,598, now pending, invented by Larry L. Byers, Joseba M. De Subijana, and Wayne A. Michielson.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates generally to the processing of instructions in a digital computer system. More specifically, it relates to the processing of conditional branch instructions whereby the operand for the branch condition to be evaluated resides on a device external to the processor.

2. Background Information

The ability to make decisions by conditional branching is an essential requirement for any computer system which performs useful work. Conditional branch instructions may be used to construct such high-level programming constructs as loops and if-then-else statements. Because loops and if-then-else programming constructs are so common, it is essential that the conditional branch instructions which implement them execute as efficiently as possible.

The decision to branch or not to branch may be based on one or more events. In most computer systems these events are referred to as conditions and are represented as bits in a condition code (CC) register. Examples of conditions include positive, negative or zero numbers, overflow, underflow, and carry from the last arithmetic operation, and many others. When a CC register is used, the condition is tested by examining the relevant bits in the CC register, which were previously set by arithmetic/logical unit (ALU) operations. An advantage of this approach is that the condition bits are sometimes set without any negative effect on the time for executing instructions. A disadvantage is that condition codes constrain the ordering of instructions since they pass information from one instruction to an immediately following branch instruction. Nevertheless, this method is used by most prior art systems.

Some systems use the "compare and branch" approach. Under this approach, the compare is actually part of the branch instruction. Thus two instructions (compare, branch) are now combined into one instruction, thereby potentially saving time. However, the set of conditions is often limited under this method and the actual implementation may be more complex and require just as much processing time as the two separate instructions.

A third approach is the use of a condition register to hold the value of the condition to be tested. This approach has the advantage being very simple. The disadvantage is that it uses up a register solely to store the condition. One way to eliminate this disadvantage is to store the condition in a register or designator on a device that is external to the processor. This idea will only be feasible if access to the external designator is obtained in an efficient manner. Another benefit of storing the condition on an external device is that now branching by a program executing on a processor may be conditioned by the results of events occurring on the external device. For example, the external device may be an independently executing VLSI gate array. The processor could change program control based upon what is being processed by the VLSI gate array.

SUMMARY OF THE INVENTION

An object of this invention is to execute a conditional branch instruction where the condition to be evaluated is obtained from a designator resident on a VLSI gate array device external to the microprocessor, thereby allowing fast coordination between the VLSI gate array and the program being executed on the microprocessor.

Another object of this invention is to execute a conditional branch instruction where the address of the next sequential instruction and the branch target address are obtained in parallel with the fetching of the branch condition from a device external to the microprocessor, thereby increasing conditional branch instruction processing speed.

Still another object of this invention is to execute a conditional branch instruction which accesses a designator on a device external to the microprocessor to obtain the branch condition, evaluates the branch condition, and optionally performs the branch, all in one instruction, thereby saving instruction processing time and space in the memory where program instructions are stored.

Additional objects, advantages and novel features of the invention will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following or may be learned by practice of the invention. The objects and advantages of the invention may be realized and attained by means of the instrumentalities and combinations particularly pointed out in the appended claims.

According to the present invention, the foregoing and other objects and advantages are attained by a method and apparatus for conditional branching within a digital computer system. The branch condition to be evaluated during the processing of the conditional branch instruction is not set as a result of the execution of the immediately preceding instruction as in many prior an systems. Instead, the branch condition is set by the operation of a VLSI gate array (called a station) that is external to the microprocessor which is executing the conditional branch instruction. The VLSI gate array is executing asynchronously to the microprocessor. The branch condition is stored in one of many designators residing on a VLSI gate array. The state of a designator is accessed by the processor to determine whether a branch is to be taken or not to be taken. In parallel with the action to obtain this value, the microprocessor obtains the branch target address from the conditional branch instruction and increments the program counter, thereby selecting the next sequential instruction to execute. If the result of the branch condition evaluation is that the branch is to be taken, the microprocessor loads the program counter with the branch target address, overwriting the address stored therein.

This unique branch instruction provides the capability to change instruction sequence control depending on a value resident in a device external to the microprocessor in a minimum amount of time. Furthermore, this action is accomplished in one instruction rather than three instructions, thereby saving space in the memory where the instruction stream is stored.

In accordance with an aspect of the invention, the apparatus includes a data processing system having conditional branch instructions stored in memory locations addressed by a program counter, one or more designators residing on a VLSI gate array, and a microprocessor for executing the conditional branch instructions. The microprocessor includes instruction decode circuitry for receiving a conditional branch instruction from a memory location addressed by the program counter and for selecting one of the external designators based on the contents of the conditional branch instruction. The microprocessor also includes branch evaluation circuitry for evaluating the selected external designator and loading the program counter with the address to the next sequential memory location or the memory location contained in the conditional branch instruction, depending on the value of the selected external designator.

In accordance with another aspect of the invention, a method of executing conditional branch instructions stored in memory locations addressed by a program counter comprises fetching a conditional branch instruction from the memory location addressed by the program counter. The conditional branch instruction is then decoded to select an external designator, obtain a branch condition indicator, and obtain a branch target address. Finally, the value of the selected external designator is obtained and the program counter is loaded with the address of the next sequential memory location after the current memory location addressed by the program counter or the branch target address, depending on the value of the selected external designator and the branch condition indicator.

Still other objects and advantages of the present invention will become readily apparent to those skilled in the art from the following detailed description, wherein is shown and described only the preferred embodiment of the invention, simply by way of illustration of the best mode contemplated of carrying out the invention. As will be realized, the invention is capable of other and different embodiments, and its several details are capable of modifications in various obvious respects, all without departing from the invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates the environment in which this invention operates.

FIG. 2 is a block diagram illustrating the Data and Data Parity paths of the Micro Bus.

FIG. 3 is a block diagram illustrating the Address and Address Parity paths of the Micro Bus.

FIG. 4 shows the format of an Address for the Micro Bus.

FIG. 5 is a block diagram illustrating the Branch On External Condition control signals that are output from the Microsequencer Bus Controllers to the Micro Bus.

FIG. 6 is a block diagram illustrating the External Branch Condition and Continue control signals output from each Station to the Microsequencer Bus Controllers.

FIG. 7 is a block diagram of the main components of the Microsequencer Bus Controller and a Station that relate to External Branch instruction execution.

FIG. 8, comprising FIG. 8(A) through FIG. 8(D), is a detailed diagram illustrating the architecture of a Microsequencer Bus Controller.

FIG. 9 shows the format of an External Branch instruction.

FIG. 10 and FIG. 11 are flow charts illustrating the processing steps performed in executing an External Branch instruction.

FIG. 12 is a timing diagram of the processing of the External Branch instruction.

DESCRIPTION OF THE PREFERRED EMBODIMENT

I. Microsequencer Bus Controller System Architecture

FIG. 1 illustrates the environment in which this invention operates. The Microsequencer Bus Controller System provides the capability of flexible, microprocessor-based control of multiple gate arrays on a circuit card within a larger computer system. It is a flexible solution to the problem of controlling function-specific VLSI gate arrays on one circuit card because one or more gate arrays can be changed without any other changes in the Microsequencer Bus Controller System hardware. When a gate array is changed, a corresponding change to the program the microprocessors execute may easily be made.

The Microsequencer Bus Controller System 10 contains up to eight Stations 12, 14, 16, 18, 20, 22, 24, and 26 connected to a hi-directional internal communication bus called the Micro Bus 28. A Station is a collection of logic implemented in a gate array on a VLSI part produced with CMOS 448 technology that performs specific functions. A Station is coupled to the Micro Bus 28 and also may interface with another bus, I/O mechanism, or other subsystems that are external to the Microsequencer Bus Controller System. That is, it may read data from or write data to other hardware components in a larger computer system. In the preferred embodiment, there are ten different gate array designs representing Stations in the system. However, it is possible that any custom designed gate array supporting a set of required functions can fulfill the role of a Station and be connected to the Micro Bus 28. A Station contains multiple designators. A designator is a binary indicator, commonly implemented by a flip-flop, which indicates the current status of an event or function in the Station. Designators are considered "external" conditions because they exist on a device (the Station) that is external to the microprocessors.

The Micro Sequencer Bus Controller (uSBC) 0 30 and uSBC 1 32 are special purpose reduced instruction set (RISC) microprocessors that control the operation of the Stations via the Micro Bus 28. The uSBCs execute an instruction stream that is stored in the Control Store 34, a high speed static random access memory (SRAM). The instruction stream may contain conditional branch instructions where the branch condition is stored in a designator resident on one of the Stations. The instruction stream is written into the Control Store 34 at system initialization time. The instruction stream is fetched by uSBC 0 30 from the Control Store 34 over Line 36. The same instruction stream is fetched by uSBC 1 32 from the Control Store 34 over Line 38. The first microprocessor, uSBC 0 30, is the master, and the second microprocessor, uSBC 1 32, is the slave. The master and slave execute the same instructions at the same time, but only the master microprocessor writes data on the Micro Bus 28. Results of operations performed by the slave microprocessor uSBC 1 32 are forwarded over Line 40 to the master microprocessor uSBC 0 30, where they are compared with the results of operations performed by the master microprocessor uSBC 0 to detect any possible errors. The uSBCs connect to the Micro Bus 28 over three distinct sets of lines: Data Lines 42, Address Lines 44, and Control Lines 46.

The Micro Bus 28 is a bi-directional bus used by the uSBCs to communicate with the Stations and for data transfer between Stations. It provides access from a uSBC to hardware designators resident on a Station. The Maintenance Clock Control (MTCC) gate array 48 provides maintenance operations such as fault detection, clock distribution and control, and system reset/recovery for all components of the Microsequencer Bus Controller System 10. The MTCC drives a bus enable line, which allows the uSBCs 30, 32, and the Stations to drive data on the Micro Bus 28.

II. The Micro Bus

The Micro Bus 28 is a bi-directional bus which provides communication paths between the uSBCs and the Stations. The Micro Bus consists of Data lines 42, Address lines 44, and various Control lines 46. The address portion of the bus is capable of addressing up to eight Stations. The Stations and the uSBCs transmit and receive data between themselves across the Micro Bus. The Micro Bus is adaptable to either a 36 bit data bus, or a 32 bit data bus. The mode of parity checking on the Micro Bus is different depending on whether the data bus is 36 bits or 32 bits.

The Micro Bus timing is defined in terms of the clock cycles it takes for the data transmitted on the bus to propagate from the transmitter to the receiver. This time is three machine clock cycles.

A. Bi-directional Signals

FIG. 2 is a block diagram illustrating the Data and Data Parity paths of the Micro Bus. The Data path 50 between the uSBCs 30, 32, and the Stations 12, 14, 16, 18, 20, 22, 24, and 26, consists of 36 bits. The Data Parity path 52 consists of two bits. Data 50 can be sent by uSBC 0 30 to a Station, and Data 50 can be received by both uSBC 0 30 and uSBC 1 32. Data Parity can be sent from a uSBC to a Station, or from a Station to a uSBC.

B. Signals From A uSBC To A Station

1. Address and Address Parity Signals

FIG. 3 is a block diagram illustrating the Address and Address Parity paths of the Micro Bus. Each uSBC can independently put 11 bits of Address 54 onto the Micro Bus 28 to select a Station and register or external designator from which to read data or write data. For bus driving reasons, each uSBC drives four Stations. USBC 0 30 drives the addresses for Stations 1, 2, 3, and 4, labelled 12, 14, 16, and 18, respectively, and uSBC 1 32 drives the addresses for stations 5, 6, 7, and 8, labelled 20, 22, 24, 26 respectively. An Address Parity bit 56 corresponding to each Address is also put onto the Micro Bus. This Address Parity bit represents the odd parity of the Address 54.

FIG. 4 shows the format of an Address 44 for the Micro Bus 28. The Station Selector field 58, stored in bits 0-2, is used to address one of the eight Stations. The Based Addressing Bit field 60, stored in bit 3, is used to select one of two possible modes of operation: Direct addressing, when clear, or Based addressing, when set. Direct addressing is used to address registers and designators on a Station that do not have a particular addressing structure. Direct addressing allows for access to as many as 128 registers and/or designators if the station is designed to accommodate both Direct and Based addressing modes. If the Station does not have Based addressing mode, then up to 256 registers and/or designators can be addressed. Based addressing is used to reference register stacks, and allows addressing of buffers up to 128 registers deep. Since the Micro Bus 28 is either 32 or 36 bits wide, the number of possible addressable registers or designators on a Station could be as high as 2*N, where N is either 32 or 36 as applicable. The Register Buffer Index field 62, stored in bits 4-10, indicates which register or designator to reference within the selected Station.

2. Branch On External Condition Signals

FIG. 5 is a block diagram illustrating the Branch On External Condition control signals that are output from the Microsequencer Bus Controllers to the Micro Bus. There are eight Branch On External Condition signals output from the uSBCs. USBC 0 30 drives Stations 1, 2, 3, and 4, labelled 12, 14, 16, and 18, respectively, with Branch On External Condition signal 64. USBC 1 32 drives Stations 5, 6, 7, and 8, labelled 20, 22, 24, and 26, respectively, with Branch On External Condition signal 72. The Branch On External Condition signal is generated by a uSBC when it executes a External Branch (BRCH) instruction, which tests the state of a designator located on a Station. The state of the designator tested is used to determine whether a branch is taken during the execution of the instruction stream.

C. Signals From A Station To A uSBC

1. External Branch Condition Signals

FIG. 6 is a block diagram illustrating the External Branch Condition and Continue control signals output from each Station to the Microsequencer Bus Controllers. Stations 12, 14, 16, 18, 20, 22, 24, and 26, output External Branch Condition signals 80, 82, 84, 86, 88, 90, 92, and 94, respectively. The External Branch Condition signal indicates the logic level of the external designator specified by the Address 54. If the addressed external designator is set, the External Branch Condition signal is a logic high, and if the addressed external designator is clear, the signal is a logic low. The External Branch Condition signal allows the uSBC to determine which path to take when the uSBC is executing a conditional External Branch instruction.

2. Continue Signals

FIG. 6 also shows eight Continue control signals. Each Station outputs a Continue signal, which is similar to an acknowledgement signal. Stations 12, 14, 16, 18, 20, 22, 24, and 26, output Continue signals 81, 83, 85, 87, 89, 91, 93, and 95, respectively. The Continue signal communicates to the uSBC requesting a function to be performed that the Station has received the request and is executing the request. The Continue signal is used to lock out other Station activity on the Micro Bus 28 while the selected Station performs the requested task. The uSBCs simultaneously monitor the Continue signals from each Station to detect erroneous signals, and the uSBCs will halt all operations upon detection of erroneous Continue signals.

III. The Control Store

Referring back to FIG. 1, the Control Store 34 is used to store the instructions that are executed by uSBC 0 30 and uSBC 1 32. These instructions are 44 bits wide. The Control Store 34, although in reality a RAM, is used as a read-only memory (ROM). A Control Store consists of seven SRAM chips. Each SRAM holds 32 * 1024(K) 8-bit bytes of data. Each unit of data stored in a Control Store consists of 44 bits of instruction, 8 bits of parity for the instruction, and 2 bits of address bit parity (one bit for even address drivers, one bit for odd address drivers). Since there are seven SRAMs, each holding 8 bits per byte, a total of 56 bits is available for storage of each storage unit if part of each storage unit is stored in each of the seven SRAMs.

The Control Store 34 is loaded with instructions at system initialization time. The parity bits and address bits are computed and appended to each instruction as it is stored. Later, as uSBC 0 30 and uSBC 1 32 are executing instructions, each instruction is fetched from the Control Store and parity values are computed from it. Each uSBC compares the parity values computed by it against the parity checks stored in the Control Store. If there are any discrepancies, the Control Store is assumed to be corrupted and an internal check condition is raised in the uSBC. This is a fatal error for uSBC processing. The error is reported to the MTCC 48 and processing is halted.

IV. The Microsequencer Bus Controller

The Microsequencer Bus Controller (uSBC) is a special purpose microprocessor that executes instructions to monitor and control the transfer of data within the Microsequencer Bus Controller System 10. Refer to FIG. 1. There are two uSBCs in the system to ensure that all data manipulations are verified with duplex checking. One is considered to be the master 30, and the other the slave 32. Only the master uSBC 30 drives the Data 42 on the Micro Bus 28, but both master and slave uSBCs drive Address 44 and Control 46 signals to lower the loading on the Micro Bus 28. The slave uSBC 32 sends the results of each instruction to the master uSBC 30 on a separate Line 40. The master uSBC then compares this value to the result it computed. If the values are different, an internal check error condition has occurred. This is a fatal error that is reported to the MTCC 48. The uSBC processing is halted because of the error. Notice that the uSBCs, although connected to the Micro Bus, are not considered to be Stations. Furthermore, the slave uSBC has its transmitters disabled, thus it can only receive Data 42 from the Micro Bus 28.

The uSBCs also interface with the MTCC 48 for initialization and maintenance functions, and clock circuitry to receive signals that control the sequential elements of the uSBC.

A. uSBC Architecture

FIG. 7 is a block diagram of the main components of the Microsequencer Bus Controller and a Station that relate to External Branch instruction execution. The Instruction Decode logic 100 fetches instructions from the Control Store 34 and decodes the instruction to determine which command is requested, what operands the command is to be executed with, and which one of the Stations, if any, operands are to be fetched from or the result is to be written to. The result of the instruction decoding is forwarded to Station Activity Control logic 102, which controls the operation of the Micro Bus 28. For the External Branch insreaction, the Branch 0n External Condition signal 64 is set, thereby notifying the Station 12 that an External Branch instruction is being processed. The Station 12 has Signal Detect logic 104 that detects the arrival of the Branch On External Condition signal. The Station sends back a Continue signal 81 to notify the uSBC that it has received the request. The Station 12 obtains the designator identifier from the Address 54 placed by the uSBC on the Micro Bus 28. The Test Designator State logic 108 retrieves the specified external designator value and the Send Status logic 110 forwards this information back to the uSBC by setting the External Branch Condition signal 80 either high or low, depending on the value of the external designator. The External Branch Condition signal 80 is detected by External Branch Detect logic 112. Branch Logic 114 determines the flow of instruction control by examining the External Branch Condition signal 80 received from Send Status 110, and the results of the Instruction Decode logic 100. The address of the next instruction to be fetched from the Control Store 34 is placed in the Program Counter 116 via Multiplexor (MUX) 118.

FIG. 8, comprising FIG. 8(A) through FIG. 8(D), is a detailed diagram illustrating the architecture of a Microsequencer Bus Controller. The Control Store 34 holds the instructions to be executed by the uSBC. The Control Store 34 is accessed by the uSBC via Bi-Directional Line 36, which is controlled by Bus Control Logic 408. The Bus Address Register 409 holds the address of the designator specified by the instruction, if any. The Program Counter 116 is a register that holds the address of the instruction to be fetched from the Control Store 34. The instruction is retrieved from the indicated position in the Control Store 34 and stored in the Instruction Register 410 for subsequent processing. For most instructions, the Program Counter 116 is then incremented to address the next instruction in the Control Store to execute. Multiplexor (MUX) 118 controls the input to the Program Counter 116. Input is accepted from the Program Counter itself, the Instruction Register 410, and Branch Logic 114. The address in the Control Store where the instruction was fetched from is saved by the Jump History logic 411 in the Local Store Write Register (LSW0) 413 (see FIG. 8B) over Line 412 and subsequently written to the Local Store 414.

The Local Store 414 stores data internal to the uSBC for use in executing instructions. The Local Store 414 holds 1024 36-bit words. It is accessed by storing the address to read data from or write data to in one of four special purpose registers. These registers are the Address Read 0 415, Address Read 1 416, Address Write 0 418, and Address Write 1 420. The Local Store 414 is implemented as a four port RAM cell. The four port RAM cell provides the capability of concurrent access to the memory via two read ports and two write ports.

Referring back to FIG. 8(A), the Saved Program Counter 436 is a register holding the address in the Control Store 34 where the current instruction to be executed is stored. It is loaded with a value selected by MUX 437 from the current Program Counter 116, the current Saved Program Counter 436, or the output of Branch Logic 114 over Line 441. The Saved Program Counter 436 is also stored in the Local Store 414 by Jump History logic 408. The contents of the Saved Program Counter 436 are also forwarded to MUX 504 over Line 438.

When the current instruction is a branch instruction, Branch Logic 114 (see FIG. 8(C)) determines if the branch condition has been satisfied and if it has, then Branch Logic 114 forwards the address of the instruction to be branched to over Line 441 to MUX 118 for subsequent storage in the Program Counter 116. This causes the next instruction fetched to be the instruction stored at the branch address rather than the next sequential instruction. Evaluation of the branch condition includes reading the External Branch Condition signal 80 via External Branch Detection logic 112 if the branch instruction is an External Branch instruction. It includes accepting input from the Internal Branch Detection logic 445 if the branch instruction is an Internal Branch instruction. It also includes accepting input from the Accumulator 442 if the branch instruction is a Table Branch instruction.

The instruction stored in the Instruction Register 410 is processed by two sets of logic. The Command Decode Logic 446 determines what kind of command is indicated by the instruction and forwards data and control information contained in the instruction to the Arithmetic Logic Unit (ALU) 448 over Line 450 and to the Station Activity Control logic 102 (shown on FIG. 8(D)) over Line 454. The Station Decode Logic 456 determines which Station is to be referenced by the instruction, if necessary. The Station identification information obtained by the Station Decode Logic 456 is forwarded over Line 458 to MUX 460. This Station identification information is used to select which Continue signal (1 through 8) 462 (shown on FIG. 8(D)) activation is expected as a result of the execution of the current instruction. The Station Decode Logic 456 also forwards the Station identification information directly to the Station Activity Control logic 102 over Line 464.

The Immediate Move Data register 466 (shown on FIG. 8(A)) holds the data to be transferred to a uSBC internal register, an external register, or to the Local Store 414. The Immediate Move Data 466 is obtained from the instruction stored in the Instruction Register 410.

The uSBC contains various internal registers used during processing of instructions. Operand data for an instruction is read out of the Local Store 414 and stored in general purpose Register A (REGA) 468 (see FIG. 8(B)). A mask/merge bit pattern for manipulating operand data is read out of the Local Store 414 and stored in the Mask/Merge Register (MMRG) 470. The Bus Receive Register (BUSR) 472 (see FIG. 8(A)) is a 36-bit register that holds dam, received from the Micro Bus over Line 474, resulting from an external read. It is the only uSBC register that can be written by the Micro Bus 28. During the execution of a operation to read a register on a station external to the uSBC, the resulting data is put into the BUSR 472. It can then be moved to the Local Store 414 or used as an operand for an instruction. The Accumulator (ACC) 442 (see FIG. 8(C)) is a 36-bit register that holds the results of the ALU 448 after execution of an instruction. It is the only register that can output data from the uSBC to the Micro Bus 28. Therefore, every write of an external register or designator uses the ACC 442.

There are six other special purpose registers used by the uSBC. The Local Store Base Register (LSBR) 476 is a six bit register used for Based addressing of the Local Store 414. If Based addressing is selected, the uSBC uses the contents of LSBR 476 as the six most significant bits of the 10-bit Local Store address, and obtains the four least significant bits from the instruction. Instructions use Based addressing to access the ACB Buffers 422 within the Local Store 4 14. The Maintenance Data Out Register (MDOR) 478 is used to report non-fatal errors. The Maintenance Data In Register (MDIR) 480 is a 32-bit dynamic scan/set register under the control of the Maintenance processing of the system via the MTCC 48. The MDIR is used by Maintenance to send messages to the uSBC.

The Flags Register (FLGR) 482 is a hardware flags register. It contains 16 bits which are individually tested, set, and cleared. Any number of these flags can be set/cleared in one instruction. The flags are also used as branch condition indicators. The Source Index Register (SIXR) 484 and the Destination Index Register (DIXR) 486 are 14-bit registers used for indexing external registers and as internal loop counters. The SIXR 484 is used for indexing read requests from Local Store 414, and DIXR 486 is used for indexing write requests to Local Store 414. These registers can be automatically incremented as part of the execution of many instructions. Thus they are useful and efficient loop counters.

The uSBC contains two main processing groups of logic. The Shift/Mask/Merge unit performs all shift operations, as well as masking and merging of operands. Shift logic 488 selects the contents of one of the registers described above as input data via MUX 490 and MUX 491 as shown. Control of the shift, such as shift direction and length, is obtained from the Command Decode logic 446. The results of the Shift operation are forwarded to Mask logic 492. The Mask logic 492 also obtains input data representing a mask bit pattern from the MMRG register 470 over Line 494. Results of the Mask logic 492 are forwarded to Merge logic 496. Merge logic 496 also accepts input data representing an address in the Local Store 414 from REGA 468 over Line 498 or from one of the internal registers multiplexed by MUX 489. Merge logic 496 obtains a merge bit pattern from the MMRG register 470 over Line 494. The results of the Shift/Mask/Merge operation are forwarded via Line 502 and MUX 504 to the Accumulator 442.

The ALU 448 performs all arithmetic and logical operations. It processes either 32-bit or 36-bit data words. The ALU 448 selects operand data from one of the internal registers and REGA 468 via MUX 489, or MMRG 470 over Line 494. It also obtains command information from the Command Decode Logic 446 via Line 450. The result of the arithmetic or logical operation is stored in the Accumulator 442 (see FIG. 18C) via MUX 504 and Line 508.

The Accumulator 442 selects data to store via MUX 504 from four possible sources. The first source is the Saved Program Counter 436 which forwards data over Line 438. The data from the Saved Program Counter 436 represents the address of the instruction being executed. The second source is the output from the ALU 448 over Line 508. The third source is MUX 510 which forwards Immediate Move Data from an instruction or data from one of the internal registers over Line 512. The fourth source is the output from the Shift/Mask/Merge logic grouping over Line 502.

The contents of the Accumulator 442 may be selected by MUX 490 as an operand for the execution of a subsequent instruction via Line 514. The contents of the Accumulator 442 are also stored in the Local Store 414 via Line 514. The contents of the Accumulator 442 may also be written to a register on a Station connected to the Micro Bus 28. Bus Control Logic 516 controls transfers over the bidirectional Micro Bus 28.

If the uSBC is a slave uSBC, then the contents of the Accumulator 442 are forwarded over Line 230 to the master uSBC for comparison with the result stored in the master uSBC's Accumulator. Checker logic 518 compares the two values and indicates a fatal error to the uSBC Halt logic 520 (see FIG. 8(B)) if the two values are not equal. The uSBC Halt logic 520 then stops the microprocessor. Processing is also halted if an error indication is received from one of the Stations via a Station Error 522 or Station Abort 524 signal. These signals are processed by Station Error Detection logic 525 and a error indication is forwarded to uSBC Halt logic 520. A Lock Bus signal 324 is then sent out to notify the other Stations that there is a problem. Multiple Continue Error Detection logic 526 detects errors relating to multiple Continue signals being received by the uSBC from MUX 460 over Line 528. If such an error occurs, the uSBC Halt logic 520 stops the microprocessor. Finally, if an internal fault occurs, Internal Fault Capture logic 529 detects the error and notifies the uSBC Halt logic 520.

Data may be received over the Micro Bus 28 in either full-word or half-word modes. In full-word mode, the data consists of either 32 or 36 bits, depending on the mode setting of the uSBC. In half-word mode, the data consists of either 16 or 18 bits, again depending on the mode setting of the uSBC. The data received over the Micro Bus 28 is stored in the Bus Received Register 472 after being selected by MUX 530 depending on the setting of the Half Word signal 532. If the Haft Word signal is present, then the lower half of the bits in the data sent to the Bus Received Register 472 is zeroed out.

The uSBC informs the Stations that it is transmitting data over the Micro Bus 28 by manipulating the Bus Busy lines 534. Bus Busy Logic 536 accepts as input command information from the Command Decode Logic 446 over Line 454 and Station identification information from the Station Decode Logic 456 over Line 458. The Bus Busy Logic 536 sets the corresponding Bus Busy line to high when the uSBC is transferring data from the Accumulator 442 over the Micro Bus 28 to that particular Station.

High level functional control of the Micro Bus 28 is managed by the Station Activity Control logic 102. Station Activity Control 102 implements the uSBC/Station communication protocol by setting and clearing the eight Source signals 540, four of the eight Data Destinate signals 542, four of the eight Branch On External Condition signals 64, the Latch Set signal 544, and the Latch Clear signal 546. Bus Wait Logic 548 ensures that Station Activity Control 102 does not attempt to access the Micro Bus 28 if it is not available for data transfers.

V. External Branch Instruction

One of the instructions contained in the instruction set of the uSBC is the External Branch instruction. The External Branch instruction is used to change the execution sequence of instructions in an instruction stream by evaluating a condition which is stored in an external designator on a Station. Thus, the storage location of the branch condition is external to the microprocessor. This capability allows the uSBC to test an event on a Station to determine program control.

FIG. 9 shows the format of an External Branch instruction. The CMD field (bits 0-2) 602, when equal to six, specifies that this is a branch instruction. The X field (bit 3) 604, when set, indicates that the indexed addressing mode is selected. The I field (bit 4) 606, when set, causes the SIXR 484 to be incremented by one after all data references for this instruction are complete. The ST field (bits 5-6) 608 controls the Call/Return Stack (stored in the Local Store 414) during a branch instruction. If the ST field 608 is one and the branch condition is evaluated as true, then processing of this instruction includes popping an address off the Call/Return Stack. If the ST field 608 is two and the branch condition is evaluated as true, then processing of this instruction includes resetting the Call/Return Stack. If the ST field 608 is three, then no entry is to be made in the Jump History Table (stored in the Local Store 414).

The Branch Condition Indicator "F" field (bit 7) 610 indicates whether the branch will take place on a true value (F=0) or a false value (F=1). The T field (bit 8) 612, when set, indicates that a Table Branch instruction, not an External Branch instruction, is to be executed. The MD field (bits 9-11 ) 614 specifies the mode of operation for the branch instruction. The R field (bit 32) 616 selects either BUSR 472 (when R=0) or ACC 442 (when R=1) as an input register for this instruction. If the T field 612 is clear, then the instruction is either an Internal Branch or an External Branch. The MD field 614 specifies whether the branch is internal (when MD=0) or external (when MD=4). When the branch is internal or external, the Branch Target Address field (bits 17-31 ) 618 specifies a branch target address in the Control Store 34 where the next instruction is to be fetched from, if the branch condition is satisfied. The Designator field (bits 33-43) 628 specifies an external designator resident on a Station which holds the value to be evaluated for the branch condition.

The External Branch instruction is different from ordinary branch instructions in that it uses a status external to the uSBC (a value stored in a designator on a Station) to determine whether the branch should be taken. The uSBC accesses this external status indicator to obtain and evaluate the branch condition in parallel with other steps being performed for the branch instruction, rather than fetching the value over the Micro Bus 28 and then evaluating it. The uSBC initiates an external test of the designator resident on the Station specified by the Destination field 628 of the External Branch instruction. This signal is transmitted as the Branch On External Condition signal 64 to the Station specified in the Address 54. While this request is being performed, the uSBC gets the address of the next sequential instruction in Control Store 34 memory and stores it, assuming that the branch may not be taken. The uSBC also reads the branch target address specified by the Control Store Address 618 field of the External Branch instruction. When the condition of the designator arrives over the External Branch signal 80, the Branch Logic 114 uses either the next sequential address or the branch target address, depending on the value of the condition specified by the designator, to transfer control for execution of the next instruction. Because the external designator test and address fetching are done in parallel, the execution time for this instruction is minimized.

FIG. 10 and FIG. 11 are flow charts illustrating the processing steps performed in executing an External Branch instruction. Processing of the External Branch instruction commences with the Start step 700. At Step 702 the uSBC loads the Program Counter 116 with the address of the instruction to be performed. Next, at Step 704 the uSBC loads the Instruction Register 410 with the instruction fetched from the Control Store 34 at the address pointed to by the Program Counter 116. In parallel with the loading of the insreaction, at Step 706, the uSBC loads the Bus Address Register 409 with the value contained in the Designator field 628 of the current instruction. The uSBC then increments the Program Counter 116 at Step 708 to prepare for the fetching of the next sequential instruction. At Step 710, the uSBC activates the appropriate Branch On External Condition signal 64 to notify the Station selected as part of the Designator field 628 that an External Branch instruction is being performed. When the Station detects the Branch On External Condition signal, it responds with a Continue signal which is detected by the uSBC at Step 712.

Next, the uSBC loads the next sequential instruction into the Instruction Register 410 at Step 714. Recall that the Program Counter 116 is already contains the Address of this instruction. This pre-fetching of the next sequential instruction is performed so that if the branch is not taken, the instruction is immediately ready to execute. The uSBC then loads the Branch Target Address 618, obtained from the current instruction, into the Program Counter 116 at Step 716, thereby setting up the Program Counter for the fetching of the next instruction if the branch is taken. At Step 718, the uSBC loads the Bus Address Register 409 with the Designator field 628 of the next sequential instruction (which is now in the Instruction Register 410).

When the uSBC detects the arrival of the External Branch Condition signal 80 from the selected Station 12 at Step 720, it then ready to evaluate the branch condition. The uSBC evaluates the branch condition at Step 722 by comparing the state of the External Branch Condition signal 80 with the Branch Condition Indicator "F" field 610 of the External Branch instruction. If the F field 610 is zero and the state of the External Branch signal 80 is high or if the F field 610 is one and the state of the External Branch signal 80 is low, then the Yes path 724 is taken because the branch condition is valid. Step 726 on FIG. 11 is then performed to load the Instruction Register 410 with the instruction from the Control Store 34 addressed by the Branch Target Address (contained in the Program Counter 116). A change in instruction sequence control has thus been performed and the uSBC at Step 728 executes the instruction currently in the Instruction Register 410. The Program Counter 116 is incremented (Step 730) and processing ends at Step 732.

Referring back to FIG. 10 at Step 722, if the F field 610 is zero and the state of the External Branch Condition signal 80 is low or if the F field 610 is one and the state of the External Branch Condition signal 80 is high, then the No path 734 is taken because the branch condition is invalid. Step 736 is then performed to execute the instruction that has previously been fetched into the Instruction Counter 410. The Program Counter 116 is then reloaded (Step 738) to restore the correct address. This address will be the address following the address of the External Branch instruction (i.e., one after the results of Step 708). Processing then ends at Step 732.

FIG. 12 is a timing diagram of the processing of the External Branch instruction. Clock cycles from one through 14 are shown along the horizontal axis. Relevant registers and signals are shown along the vertical axis. At clock cycle one, the Program Counter 116 is loaded with the address of the External Branch instruction (Event 800). At clock cycle five, the instruction is loaded into the Instruction Register 410 (Event 802), the Bus Address Register 409 is loaded with the Designator identifier (Event 804), and the Program Counter 116 is incremented (Event 806). At clock cycle six, the uSBC activates the Branch on External Condition signal 64 for a duration of two clock cycles (Event 808). At clock cycle eight, the Branch on External Condition signal 64 is detected by the Station 12 and latched into a Branch On External Condition designator (Event 810). The Station then activates the Condition signal 81 for a duration of two clock cycles (Event 812). At clock cycle nine, the Instruction Register 410 is loaded with the next sequential instruction (Event 814), and the Bus Address Register 409 is loaded with the Designator identifier from that instruction (Event 816). These actions are taken to prepare the next sequential instruction for execution if the branch is not taken. If the External Branch Condition is true, the Station activates the External Branch Condition signal 80 for a duration of two clock cycles starting at clock cycle nine (Event 818). If the External Branch Condition is false, the Station activates the External Branch Condition signal 80 for a duration of two clock cycles starting at clock cycle 11 (Event 820). The uSBC then can detect which state is present on the signal and latches the state into a Branch Condition designator at clock cycle 11 (Event 822). Finally, the branch evaluation is performed and a decision is made at clock cycle 13 whether to branch or not to branch (Event 824).

Under a previous approach to the problem of using external indicators as branch conditions, the uSBC performed a read of the designator and transferred the value contained therein back over the Micro Bus 28 from a Station and into an internal uSBC register (such as BUSR 472). Then the stored value would be evaluated by shifting the internal uSBC register's bits to compare a test bit, and depending on the value obtained, either a branch target address would then be fetched or the next address would be set up for the transfer of program control. This previous method requires three instructions for implementing the function: a MOVE instruction to obtain the designator's value from the Station, a SHIFT/MASK instruction to extract the test bit, and a BRANCH depending on the value of the test bit. The total time spent executing this type of branch under the previous method is 400 nanoseconds if the branch is not taken, and 500 nanoseconds if the branch is taken. However, by utilizing a direct access via the Branch On External Condition signal 64 and the corresponding External Branch Condition signal 80, this functionality is performed in only one instruction, thereby minimizing branching time. The External Branch instruction is now executed in 200 nanoseconds. Thus it provides a savings of 200 or 300 nanoseconds of execution time per External Branch instruction. The amount of space required for instructions in the Control Store 34 is also less. Two less instructions are needed in the Control Store to perform the same functionality, thereby minimizing storage requirements.

In addition, events external to the uSBC (that is, events on the Stations) are synchronized to the uSBC only when the microprocessor samples an event by attempting to access an external designator. This allows functions external to the uSBC to execute asynchronous to uSBC program control. Thus, the uSBC is available to perform other tasks after signalling the Station via the Branch On External Condition signal 64. The synchronization of the external function for testing remains close to the source or the cause of the event. Thus, the uSBC is not required to provide any program control for synchronization of the event. In addition, since the uSBC is not interrupt driven, there is no need for interrupt decoding to determine when a Station is communicating to a uSBC. Instead, the Branch On External Condition signal 64 and corresponding External Branch Condition signal 80 provide for the control to coordinate the addressing of an event on the Station.

The invention has been described in its presently contemplated best mode, and it is clear that it is susceptible to various modifications, modes of operation and embodiments, all within the ability and skill of those skilled in the art and without the exercise of further inventive activity. Accordingly, what is intended to be protected by Letters Patents is set forth in the appended claims. 

What is claimed is:
 1. In a data processing system having conditional branch instructions stored in memory locations addressed by a program counter, the data processing system including multiple branch condition flags residing on gate arrays accessed by a control processor over a bus addressed by a bus address register, the branch condition flags storing the state of a branch condition, a method of executing a conditional branch instruction in the control processor by reading the branch condition flags resident on the gate arrays comprising the steps of:(a) loading the program counter with the address of a conditional branch instruction, (b) loading an instruction register with said conditional branch instruction fetched from the memory location at the address pointed to by the program counter, (c) in parallel with step (b), loading the bus address register with the address of a branch condition flag and its associated gate array selected by said conditional branch instruction, (d) incrementing the address contained in the program counter, the result being the address of the next sequential instruction, (e) activating a branch on external condition signal from the control processor to said selected gate array to notify said selected gate array that said conditional branch instruction is being executed by the control processor, (f) detecting said branch on external condition signal by said selected gate array, (g) activating a continue signal by said selected gate array which is detected by the control processor, (h) loading said next sequential instruction into said instruction register, (i) loading a branch target address obtained from said conditional branch instruction into the program counter, (j) loading the bus address register with an address of a branch condition flag specified by said next sequential instruction, (k) sensing the state of said selected branch condition flag and activating an external branch condition signal matching the state of said selected branch condition by said selected gate array, (l) detecting said external branch condition signal representing the value of the branch condition from said selected gate array by said control processor, (k) obtaining the state of said selected branch condition flag from said external branch condition signal, (l) evaluating a branch condition indicator obtained from said conditional branch instruction and said state of said selected branch condition flag to determine if said branch is to be taken, (m) loading said instruction register with the instruction addressed by said branch target address when said branch is to be taken, and (n) reloading the program counter with said address of said next sequential instruction and loading said instruction register with said next sequential instruction when said branch is not to be taken.
 2. A data processing system that executes conditional branch instructions stored in memory locations addressed by a program counter, the data processing system having branch conditions stored in memory device external to the processor executing the conditional branch instructions said data processing system comprisinga plurality of branch condition request lines; a plurality of acknowledgement lines; a plurality of branch condition lines; a plurality of gate arrays, each of said gate arrays connected to a first end of one of said plurality of branch condition request lines, to a first end of one of said plurality of acknowledgment lines, and to a first end of one of said plurality of branch condition lines, each of said gate arrays including:a plurality of branch condition flags, each of said branch condition flags storing the boolean state of a branch condition, testing circuitry connected to said branch condition flags to determine the state of said designators, signal detecting circuitry connected to said testing circuitry, to said first end of one of said plurality of branch condition request lines, and to said first end of one of said plurality of acknowledgment lines, said signal detecting circuitry receiving a request signal over said one of said plurality of branch condition request lines to test the state of a selected one of said branch condition flags and sending an acknowledgment signal over said one of said plurality of acknowledgment lines, and signal sending circuiny connected to said testing circuitry and to said first end of one of said plurality of branch condition lines to send a status signal representing the state of said selected branch condition flag over said one of said plurality of branch condition lines, and one or more processors for executing conditional branch instructions, connected to said plurality of gate arrays by a second end of said plurality of branch condition request lines for sending said request signals, by a second end of said plurality of acknowledgment lines for receiving said acknowledgment signals, and by a second end of said plurality of branch condition lines for receiving said status signal, each of said one or more processors including:instruction decode circuitry connected to the memory locations to receive a conditional branch instruction from a memory location addressed by the program counter and to select one of said branch condition flags residing on one of said gate arrays, said selected branch condition flag being specified by the contents of the conditional branch restruction, control circuitry connected to said instruction decode circuitry, to said second end of said plurality of branch condition request lines, and to said second end of said plurality of acknowledgment lines, to send said request signal to said selected one of said plurality of gate arrays to request said selected gate array to test said selected branch condition flag, and to receive said acknowledgment signal from said one of said plurality of gate arrays, detection circuitry connected to said second end of said plurality of branch condition lines to receive said status signal, and branch evaluation circuitry connected to said detection means to evaluate said status signal and load the program counter with an address to the next sequential memory location or another memory location depending on the value of said status signal. 